package org.company.tool.bean;

import org.apache.commons.lang3.StringUtils;
import org.company.tool.util.StringUtil;

/**
 * 
 * @ClassName:EntityBean.java
 * Title:
 * Description:
 * Copyright:Copyright(c)2012
 * Company:www.si-tech.com.cn
 * @date:2012-12-11
 * @version 1.0
 */
@SuppressWarnings("serial")
public class EntityBean extends JavaClass {
	/**
	 * 数据库表名
	 */
	private String tableName;
	
	/**
	 * sqlMap文件名
	 */
	private String sqlMapFileName;
	
	/**
	 * 文件位置
	 */
	private String sqlMapLocation = ".";

	public String getSqlMapLocation() {
        return sqlMapLocation;
    }

    public void setSqlMapLocation(String sqlMapLocation) {
        this.sqlMapLocation = sqlMapLocation;
    }

    public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getSqlMapFileName() {
		return sqlMapFileName;
	}

	public void setSqlMapFileName(String sqlMapFileName) {
		this.sqlMapFileName = sqlMapFileName;
	}

	public EntityBean(String tableName,String packageName,String location,String sqlMapLocation) {
	    super(StringUtils.capitalize(StringUtil.nameTransfer(tableName.toLowerCase())),packageName,location);
		this.tableName = tableName;
		this.sqlMapFileName = this.getClassName() + "SQL.xml";
		this.sqlMapLocation = sqlMapLocation;
	}
	
	public EntityBean(String tableName,String packageName) {
	    this(tableName,packageName,"","");
	}
	
	public EntityBean(String tableName) {
	    this(tableName,"","","");
	}
}
